import csv


def readFileToArray(filepath):
    file=open(filepath,"r")
    row=file.readlines()
    list_test=[]
    for line in row:
        line=list(line.strip().split('\t'))
        s=[]
        for i in line:
            s.append(float(i))
        list_test.append(s)
    return list_test

def readTxAndFromFileToArray(filepath):
    fileReader=csv.reader(open(filepath,"r"))
    list=[]
    head=next(fileReader)#读取头，没啥用，第一列是txhash，第二列是fromID
    for row in fileReader:
        list.append(row)
    return list

def readTxToArray(filepath):
    fileReader=csv.reader(open(filepath,"r"))
    list=[]
    for row in fileReader:
        list.append(row)
    return list

